package modelkontrol;

import hibernate.HibernatePasienUtil;
import model.DPemeriksaanObat;

import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.hibernate.Transaction;

public class KontrolPemerisaanObat {
	public void savePemeriksaanObat(DPemeriksaanObat pemeriksaanObat)
	{
		Session session = HibernatePasienUtil.getSessionFactory().openSession();
		Transaction transaction = null;
	
		try {
			transaction = session.beginTransaction();
			session.save(pemeriksaanObat);
			transaction.commit();
		} catch (HibernateException e) {
			transaction.rollback();
			e.printStackTrace();
		} finally {
			session.close();
		}
	}
}
